package com.cait.dutyfree.pojo;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.Table;

@Entity
@Table(name = "customer_events")
public class CustomerEvent implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 2486557047125605253L;

	private Integer id;
	private Date loginTime;
	private String ip;
	private String event;

	private Customer customer;

	/**
	 * @param loginTime
	 * @param ip
	 * @param user
	 * @param event
	 */
	public CustomerEvent(Date loginTime, String ip, Customer customer,
			String event) {
		super();
		this.loginTime = loginTime;
		this.ip = ip;
		this.customer = customer;
		this.event = event;
	}

	/**
	 *
	 */
	public CustomerEvent() {
		super();
	}

	/**
	 * @return the eventId
	 */
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	public Integer getId() {
		return id;
	}

	/**
	 * @param eventId
	 *            the eventId to set
	 */
	public void setId(Integer id) {
		this.id = id;
	}

	/**
	 * @return the loginTime
	 */
	public Date getLoginTime() {
		return loginTime;
	}

	/**
	 * @param loginTime
	 *            the loginTime to set
	 */
	public void setLoginTime(Date loginTime) {
		this.loginTime = loginTime;
	}

	/**
	 * @return the ip
	 */
	public String getIp() {
		return ip;
	}

	/**
	 * @param ip
	 *            the ip to set
	 */
	public void setIp(String ip) {
		this.ip = ip;
	}

	/**
	 * @return the event
	 */
	public String getEvent() {
		return event;
	}

	/**
	 * @param event
	 *            the event to set
	 */
	public void setEvent(String event) {
		this.event = event;
	}

	/**
	 * @return the user
	 */
	@OneToOne(cascade = CascadeType.ALL)
	public Customer getCustomer() {
		return customer;
	}

	/**
	 * @param user
	 *            the user to set
	 */
	public void setCustomer(Customer customer) {
		this.customer = customer;
	}

}
